//
//  XJ_HomeDetaiViewController.m
//  XunJieProject
//
//  Created by xue on 2018/6/12.
//  Copyright © 2018年 Soowin. All rights reserved.
//

#import "XJ_HomeDetaiViewController.h"
#import "XJ_ManageCreditCardViewController.h"
#import "XJ_QuickRepaymentViewController.h"
@interface XJ_HomeDetaiViewController ()
@property (weak, nonatomic) IBOutlet UIButton *comfirBtn;

@property (weak, nonatomic) IBOutlet ZDXXibTextField *bankNameTF;
@property (weak, nonatomic) IBOutlet ZDXXibTextField *cardIDTF;
@property (weak, nonatomic) IBOutlet ZDXXibTextField *nameTF;

@property (weak, nonatomic) IBOutlet ZDXXibTextField *zhangDanRiTF;
@property (weak, nonatomic) IBOutlet ZDXXibTextField *huanKuanRiTF;
@property (weak, nonatomic) IBOutlet ZDXXibTextField *yiHuanJinErTF;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *scrollViewTop;

@end

@implementation XJ_HomeDetaiViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _scrollViewTop.constant = SafeAreaTopHeight;
    // Do any additional setup after loading the view from its nib.
}

-(void)creatMainUI{
    
    self.nav_titleLabel.text =@"信用卡";
    self.nav_rightButton.hidden =NO;
    [self.nav_rightButton setTitle:@"管理" forState:UIControlStateNormal];
    [self.nav_rightButton addTarget:self action:@selector(Click_right) forControlEvents:UIControlEventTouchUpInside];
    
    _comfirBtn.backgroundColor =Color_ZhuSeDiao;
    _comfirBtn.layer.cornerRadius =4;
    _comfirBtn.layer.masksToBounds =YES;
    
    _bankNameTF.text =_cardModel.bank;
    _cardIDTF.text = _cardModel.cardId;
    _nameTF.text = _cardModel.cardUserName;
    _zhangDanRiTF.text = _cardModel.billDate;
    _huanKuanRiTF.text = _cardModel.backMoneyDate;
    _yiHuanJinErTF.text = _cardModel.alreadyBackMoney;
    
    NSInteger backPlan =_cardModel.backPlan;
    if (backPlan==0) {
        _comfirBtn.backgroundColor =Color_ZhuSeDiao;
        _comfirBtn.userInteractionEnabled =YES;

    }else{
        
        _comfirBtn.backgroundColor =[UIColor lightGrayColor];
        _comfirBtn.userInteractionEnabled =NO;
    }
    
}

-(void)Click_right{
    
    XJ_ManageCreditCardViewController *manage =[[XJ_ManageCreditCardViewController alloc]init];
    manage.cardModel = _cardModel;
    [self.navigationController pushViewController:manage animated:YES];
    
}
- (IBAction)quickRepaymentAction:(id)sender {
    
    XJ_QuickRepaymentViewController * VC = [[XJ_QuickRepaymentViewController alloc]init];
    VC.cardModel = _cardModel;
    [self.navigationController pushViewController:VC animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
